package com.ngc.mall.controller;

import com.ngc.mall.common.configure.response.ResponseResult;
import com.ngc.mall.param.ActivityParam;
import com.ngc.mall.service.IActivityService;
import com.ngc.mall.vo.ActivityCouponVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 *
 * 活动
 * @author: chenxiaolin
 * @date 2023/8/29 0:34
**/
@RestController
@RequestMapping("/activity")
public class ActivityController {

    @Resource
    private IActivityService iActivityService;

    @PostMapping("/by/keywords")
    @ApiOperation("根据关键字查看活动")
    public ResponseResult<List<ActivityCouponVO>> findByKeywords(@RequestBody ActivityParam activityParam){
        return ResponseResult.success(iActivityService.findByKeywords(activityParam.getKeywords()));
    }


}
